package com.baizhi.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * 是否操作成功
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class CommonMessageVO {
    private String message;
    private Object status;

    public static CommonMessageVO succeed(String message,Object status){
        CommonMessageVO messageVO = new CommonMessageVO();
        messageVO.setMessage(message);
        messageVO.setStatus(status);
        return messageVO;
    }

    public static CommonMessageVO succeed(String message){
        CommonMessageVO messageVO = new CommonMessageVO();
        messageVO.setMessage(message);
        messageVO.setStatus(200);
        return messageVO;
    }
    public static CommonMessageVO succeed(){
        CommonMessageVO messageVO = new CommonMessageVO();
        messageVO.setMessage("操作成功");
        messageVO.setStatus(200);
        return messageVO;
    }
    public static CommonMessageVO failed(String message){
        CommonMessageVO messageVO = new CommonMessageVO();
        messageVO.setMessage(message);
        messageVO.setStatus(400);
        return messageVO;
    }
    public static CommonMessageVO failed(){
        CommonMessageVO messageVO = new CommonMessageVO();
        messageVO.setMessage("操作失败");
        messageVO.setStatus(400);
        return messageVO;
    }
}
